placessidebar: Replace hard-coded margins with theme
authornana-4 <hnmaigo@gmail.com>
Sat, 15 Aug 2020 13:45:39 +0000 (22:45 +0900)
committernana-4 <hnmaigo@gmail.com>
Sat, 15 Aug 2020 13:46:31 +0000 (22:46 +0900)
So we can easily adjust the widget sizing in the theme.

gtk/gtkplacessidebar.c
gtk/theme/Adwaita/_common.scss
gtk/ui/gtksidebarrow.ui

index dbe9e811166de8487d03eb492b283f511c93ab84..d7ac99a788a271cc69deb97cc128c67b5bc6e596 100644 (file)
@@ -394,14 +394,11 @@ list_box_header_func (GtkListBoxRow *row,
   else
     {
       before_section_type = SECTION_INVALID;
-      gtk_widget_set_margin_top (GTK_WIDGET (row), 4);
     }
 
   if (before && before_section_type != row_section_type)
     {
       separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-      gtk_widget_set_margin_top (separator, 4);
-      gtk_widget_set_margin_bottom (separator, 4);
       gtk_list_box_row_set_header (row, separator);
     }
 }
index bddf62f6329d2d55d0121867ac6b5d0dbe58c8d4..57446f56e6e79f97b3b29efb99d8554550231781 100644 (file)
@@ -3389,6 +3389,18 @@ row image.sidebar-icon { opacity: $_placesidebar_icons_opacity; } // dim the sid
 placessidebar, .navigation-sidebar {
   > scrolledwindow.frame { border-style: none; }
 
+  list {
+    padding: 4px 0;
+
+    > row {
+      margin: 1px 0;
+    }
+
+    > separator {
+      margin: 4px 0;
+    }
+  }
+
   row {
     // Needs overriding of the GtkListBoxRow padding
     min-height: 36px;
index 38ecbf3be8ef0da8128717e26695c7db0d661745..787a4782768499116fd86f439104ea3a4e07ce47 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface domain="gtk40">
   <template class="GtkSidebarRow" parent="GtkListBoxRow">
-    <property name="margin-top">1</property>
-    <property name="margin-bottom">1</property>
     <property name="focus-on-click">False</property>
     <style>
       <class name="sidebar-row"/>